/******************************************************************************
*
*               Copyright Mentor Graphics Corporation 2003
*                           All rights reserved
*
*   THIS WORK CONTAINS TRADE SECRETS AND PROPRIETARY INFORMATION WHICH IS
*    THE PROPERTY OF MENTOR GRAPHICS CORPORATION OR ITS LICENSORS AND IS
*                        SUBJECT TO LICENSE TERMS
*
*******************************************************************************

*******************************************************************************
* FILE NAME                                                          VERSION
* act_local_fundamental_array_test.c                                   1.1
*
* COMPONENT
* ANSI/ISO C test application
*
* DESCRIPTION
* Demonstrates array declaration and operations
*
* DATA STRUCTURES
*
*
* FUNCTIONS
* int act_local_fundamental_array_test(int value)
*
* DEPENDENCIES
* act_test.h
******************************************************************************/

#include "act_test.h"

#if ACT_LOCAL_FUNDAMENTAL_ARRAY_TEST

/******************************************************************************
* FUNCTION
* int act_local_fundamental_array_test(int value)
*
* DESCRIPTION
* Demonstrates array declaration and element access
* both direct, by pointer and by ref
*
* INPUTS
* int value                             Counter sent from act_target_generic.c
*
* OUTPUTS
* int
*
******************************************************************************/
int act_local_fundamental_array_test(int value)
{
     int i;
     volatile int counter=0;
     int local_int_array[4];

     int* local_int_ptr_array[4][2];

     local_int_array[0] = 1;
     local_int_array[1] = 2;
     local_int_array[2] = 3;
     local_int_array[3] = 4;

     for (i=0; i<4; i++)
     {
          local_int_ptr_array[i][0] = &local_int_array[i];
     }

     for (i=0; i<4;i++)
     {
          counter += *local_int_ptr_array[i][0];
     }

     return( counter + value );
}
#endif
